{% extends "base.html" %}
{% block head %}
    {{ super() }}
    <style type="text/css">

    </style>

    {#    <script src='https://www.google.com/recaptcha/api.js' async defer></script>#}
    <link rel="stylesheet"
          href="{{ url_for("static",filename = "3rd/bootstrap-notify-master/css/bootstrap-notify.css") }}">
    <link rel="stylesheet"
          href="{{ url_for("static",filename = "3rd/bootstrap-notify-master/css/styles/alert-blackgloss.css") }}">
{% endblock %}

{% block maindiv %}

    <div class="classeslist row">
        {% for class in res.class %}
            <div class="col-md-4">
                <!-- Widget: user widget style 1 -->
                <div class="box box-widget widget-user-2">
                    <input name="classid" type="hidden" value="{{ class.class.class_id }}"/>
                    <div class="box-tools pull-right">
                        <button type="button" class="btn btn-box-tool" data-widget="remove"><i
                                class="fa fa-times"></i></button>
                    </div>
                    <!-- Add the bg color to the header using any of the bg-* classes -->
                    <div class="widget-user-header {{ class.class.class_color }}">
                        <div class="widget-user-image">
                            <img class="img-circle" src="/statics/img/{{ class.class.class_logo }}" alt=" Class Avatar">
                        </div>
                        <!-- /.widget-user-image -->
                        <h3 class="widget-user-username">{{ class.class.class_name }}</h3>
                        <h5 class="widget-user-desc">班主任: {{ class.tname }}, 班级邀请码: {{ class.class.invite_code }}</h5>
                        <h6 class="widget-user-desc">班级描述: {{ class.class.class_descri }}</h6>
                    </div>
                    <div class="box-footer no-padding">
                        <ul class="nav nav-stacked">
                            <li><a href="">学生数 <span
                                    class="pull-right badge bg-blue">{{ class.class.student_nums }}</span></a>
                            </li>
                            <li><a href="{{ url_for('web.getexam', cid=class.class.class_id)}}">测试数 <span
                                    class="pull-right badge bg-aqua">{{ class.class.exam_nums }}</span></a></li>
                            <li><a href="#">公告数 <span
                                    class="pull-right badge bg-green">{{ class.class.notice_num }}</span></a>
                            </li>
                        </ul>
                    </div>
                </div>
                <!-- /.widget-user -->
            </div>
        {% endfor %}
    </div>
{% endblock %}


{% block touxiang %}
     <div id="user_info">
            <div class="user_avatar" id="crop-avatar">
                <div class="avatar-view">
                    <img src="{{ res.data.avatar_url}}" class="avatar-img" alt="Logo">
                </div>
                <div class="user_avatar_cover">点击编辑头像</div>
            </div>
            <span></span>
            <div class="user_info_panel">
                <div>Lv.126</div>
                <ul>
                    <li>
                        <a>
                            <button type="button">信息修改</button>
                        </a>
                    </li>
                    <li>
                        <a href="{{ url_for('web.logout') }}">
                            <button class="logout"> 注销</button>
                        </a>
                    </li>
                    <li>
                        <a href="{{ url_for('web.logsuc') }}">
                            <button class="logout"> 首页</button>
                        </a>
                    </li>
                </ul>
            </div>
        </div>
{% endblock %}
{% block scripts %}
    {{ super() }}

    <script src="{{ url_for("static",filename="3rd/bootstrap-notify-master/js/bootstrap-notify.js") }}"></script>
    <script>
        $('#btn-login').css('display', 'none');
        $('#user_info span').css('display', 'block');
        $('#user_info span').text('你好呀,' + {{ res.data.nickname }});
        $('#user_info .user_info_panel div').text('ID:' +{{ res.data.id}});
        $('.user_info_panel').css('display', 'block');
        $('.user_avatar').on('mouseover', function () {
            $('.user_avatar_cover').css('display', 'block');
        }).css('cursor', 'pointer')
        $('.user_avatar').on('mouseout', function () {
            $('.user_avatar_cover').css('display', 'none');
        });

        $('.user_avatar').css('pointer-events', 'auto');
        $('.guest-page').css('display', 'none');
        $('.user-page').css('display', 'block');
        $('.avatar-img').attr('src', "{{ res.data.avatar_url}}");

    </script>


{% endblock %}